package com.yidu.sanrenxing.utils;

import javax.annotation.Resource;
import javax.annotation.Resources;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118604866";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCBOOeo1Y2RKnfmCrhy4QTvHOvr/h6ECHsZKbd4yNwy/dJD08WMFWDfkXsTppgWdD/xaP6sQV4yiHeAjDl7oLBJgjVijlTvqviTZTESC7S0XscGtW79qCzglP3MqNIx96r5tvfqmPEKv/Uk2ZSfKbc0LzHGKh21ORZOpqW0bIZB8VUgPxwQWAfcSDplA79iMPSorr615nMJrpMkr3T53aR+nxYdNuxUnpBdTGpUqD3iSzatgruO5uafMNMHqpYQ2nnGKsksa9kHnJYcNHHCLcUTGA8yjfF/qu3ak1mv60u8McInNv5c24ZCsFI5THERxNulA1jAUTt9pDcyWy94C7TnAgMBAAECggEAZcD/ek0e+s5sN3L9p0hVcExf4ibqtKFQ/ZGB7dSMwIJqTgq2Jga3j5SpS+IFJLlJmLlKwS2AFV6sa0cABL+V0Wx8ySy26TrCHp6yMzmQg++V3UyFJ6yEGhx4de4CBmK1+YkAU3U3aXWafffvNh3NK4R2N0r2tbtMO4ayOQ6z8bwM/vx6g1OX8M2q5s7W/uJ7H0xmZGTILvH60UogoLf8Q7dSDP/P+bfaH33Wb4ysadx+2xHlsYknlRtLCI1w3lp+1j528GeT+H96mmETdZgKoXM7lPeD30UK9Jt9AIHAv3dv1uilkIdwocVT1zuEzgLpLKL0ZfhsVThlPhnhwPND4QKBgQDNGDiNB8tZoy68WO6K+97feJwDAqb9DQ2laNesTXgTtFMCnHFM0c5OYcjKqs9JO2K0ahAhtxGcLScm6Y0etTVcPoi/z0//Gbr60tLvTENbwg1YJvlpsdtoXGzaw6/PGxStbhXpclglcIe4nwEfWzZvFwamqWB6P6XTnBdX7sQM/wKBgQChS7s6g7txgzGphSTmtQd0WrAJkZlOOTelCzgAVnmaDue7qHKyIC+7QQ2M4qvdCVzsERA8tFms6dBJZCrQNFmJ6B8PLFzdJz08CF43bqVT/P0ychoMK59F3nluGy0k8EjtPpaoMTzDKkAQ3TyQ5PrJ77iwk7T8vfwxsK4PdWmQGQKBgFyA2yjI5i/kyPSMi/LFzW0vofY9oQGrfIcpdXUyb8E7aOFZnESQsKNruTuntNyL22YSHHqIbnnpZ6pGVq8N/iY/0j/pCmS9vzbYFel2lT7ylEA5O+8vGA3G+hXlgws/ZKEgcOOc/iLM0Xo0xTXWVwPd99L9vBUHVgzObzzq5SQTAoGAGFaWFNlF0nYKa1r0238bddotT/RRXrVRiSztMVfbF30CSJW9YNVsfmPtiIG3jy3XgKN+gLpyAZ5yWHCt6SbND/sfnKmEBbbjDYjxtomSlt7I0fDXr1hxuxg72HpvUHCVgH7+OrjbQ1O/wQuxFOgIU6pBgxt2puCACntveFOuLxkCgYBbuROICGORuorE3PSkRP5q19PTu81wyXiRRqTYsRgXiFrtQ29vxxb0JrElTOYuQgUSbXIM3EF0xIbWdnra+UAGKdGJeF6+b2VdlRD1ij0XK56nCbm8q8aUDccY8Xoqv+xnQKMXfoZuMYSnbKk+iJDWPa0gy5294zqEEevoP4B5jg==";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnULcvZEdzHR3hsUYUUjWXGFKq52ji5QdkzaMcwzT7yOoqHHOL1wIciV0LW4IMnfgWOsyEDSTbCL0o9MnngdCEi6WOTOgMHXAABWDQWq1O0DTVpNirwm5tjy09TaO4P0dctj3o/A5+KtLiK46F8YeslSIeBMOBkkH30i8rP0A23tkqx7XtBG8OmTOkK0mKP2+svqIeed7GLxl2ue5wufcgW6xHP2EbP0hkIuHGwdBNAEKhWoArS6Vl0hw+zImcXeISDPNV88nlAvXdKd6V3O8AuzzK36UIB287oaOOWvGfCKB9P1zb/Lh/NnCkhXJBlN9Hdq0n7YqpTVjq7y14AsH1QIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8888/api/alipaySuccess";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8888/api/alipaySuccess";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

